﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Web;

namespace BookExchange.ViewModel
{
    public class FileDownloadInfo
    {

        public FileDownloadInfo(FileInfo fileInfo)
            : this(fileInfo.Name, fileInfo.Length, fileInfo.CreationTime)
        {

        }

        public FileDownloadInfo(string fileName, long fileSize, DateTime uploadDate)
        {
            this.Name = fileName;
            this.Size = fileSize;
            this.Date = uploadDate.ToString();
        }


        public string Date { get; set; }
        public long Size { get; set; }
        public string EncodedName { get; set; }
        public string Name { get; set; }
        public string DownloadUrl
        {
            get
            {
                return "http://bookexchange.travianoverview.com/Files/" + this.Name;
            }
        }
    }
}